//
//  Comment.swift
//  MyDiary2025
//
//  Created by 罗万能 on 2025/6/27.
//

import SwiftData
import Foundation

typealias Comment = CommentV1

@Model
class CommentV1{
    var id: UUID
    var content: String
    var date: Date
    init(id: UUID, content: String, date: Date) {
        self.id = id
        self.content = content
        self.date = date
    }
    static var debugDatas:[Comment] = {
        var comments :[Comment] =
        [
            Comment(id: UUID(), content: "comment1comment1comment1com\nment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1comment1", date: Date.now.addingTimeInterval(TimeInterval(Int.random(in: -500..<0)))),
            Comment(id: UUID(), content: "comment2", date: Date.now.addingTimeInterval(TimeInterval(Int.random(in: -500..<0)))),
            Comment(id: UUID(), content: "comment3", date: Date.now.addingTimeInterval(TimeInterval(Int.random(in: -500..<0)))),
            Comment(id: UUID(), content: "comment4", date: Date.now.addingTimeInterval(TimeInterval(Int.random(in: -500..<0)))),
            Comment(id: UUID(), content: "comment5", date: Date.now.addingTimeInterval(TimeInterval(Int.random(in: -500..<0)))),
            Comment(id: UUID(), content: "comment6", date: Date.now.addingTimeInterval(TimeInterval(Int.random(in: -500..<0)))),
        ]
        return comments
    }()
}
